{{$queryString = ''}}
{{if $query|default}}
{{$query = ','|explode:$query}}
{{foreach $query as $v}}
{{if $_param.get.$v|default}}{{$queryString = $queryString|cat:'&amp;'|cat:$v|cat:'='|cat:$_param.get.$v}}{{/if}}
{{/foreach}}
{{/if}}
{{if $smarty.get.r|default == $name}}
<a href="?r=_{{$name}}{{$queryString}}">{{$label}}▲</a>
{{else if $smarty.get.r|default == '_'|cat:$name}}
<a href="?r={{$name}}{{$queryString}}">{{$label}}▼</a>
{{else}}
<a href="?r=_{{$name}}{{$queryString}}">{{$label}}</a>
{{/if}}